package com.atguigu.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;
import java.util.Map;

/**
 * @auther zzyy
 * @create 2025-01-03 13:44
 */
@RestController
@Slf4j
public class DemoController {
    //  http://localhost:3345/demo/test/1
    @GetMapping("/demo/test/{id}")
    public Map<String, String> test(@PathVariable("id") Integer id) {
        log.info("业务：user.id: {}", id);
        Map<String, String> result = new HashMap<>(2);
        result.put("code", "200");
        int i = 1;
        //i = i / 0;
        return result;
    }
}
